package com.chen.utils;
import com.chen.expection.ErrorCode;
import com.chen.expection.expection.ServiceExpection;



public class ServiceExpectionUtil {
    /**
     * 抛出异常
     * @param errorCode
     * @return
     */
    public static ServiceExpection expection(ErrorCode errorCode){
        ServiceExpection expection = new
                ServiceExpection(errorCode.getCode(), errorCode.getMsg());
        return expection;
    }

    /**
     * 抛出异常
     * @param code
     * @param msg
     * @return
     */
    public static ServiceExpection expection(String code, String msg){
        ServiceExpection expection = new
                ServiceExpection(code, msg);
        return expection;
    }
}
